---
title: Ripple
description: "`Ripple` is a component that adds a ripple effect to elements, allowing users to recognize when they have clicked."
source: components/ripple
style: components/ripple/ripple.style.ts
---

```tsx preview functional client
const { onClick, ...rippleProps } = useRipple()

return (
  <Center
    as="button"
    type="button"
    onClick={onClick}
    h="10"
    px="3"
    bg="bg.contrast"
    color="fg.contrast"
    rounded="l2"
    position="relative"
    overflow="hidden"
  >
    <Text>Button</Text>

    <Ripple {...rippleProps} />
  </Center>
)
```

:::warning
You need to set `position: relative` and `overflow: hidden` on the parent element of `Ripple`.
:::

## Usage

:::code-group

```tsx [package]
import { Ripple, useRipple } from "@yamada-ui/react"
```

```tsx [alias]
import { Ripple, useRipple } from "@/components/ui"
```

```tsx [monorepo]
import { Ripple, useRipple } from "@workspaces/ui"
```

:::

```tsx
<Ripple />
```

### Change the Color

To change the color, set a color to `color`. By default, `currentColor` is set.

```tsx preview functional client
const { onClick, ...rippleProps } = useRipple()

return (
  <Center
    as="button"
    type="button"
    onClick={onClick}
    h="10"
    px="3"
    bg="bg.contrast"
    color="fg.contrast"
    rounded="l2"
    position="relative"
    overflow="hidden"
  >
    <Text>Button</Text>

    <Ripple color="warning" {...rippleProps} />
  </Center>
)
```

### Disable Ripple

To disable, set `disabled` to `true`.

```tsx preview functional client
const { onClick, ...rippleProps } = useRipple({ disabled: true })

return (
  <Center
    as="button"
    type="button"
    onClick={onClick}
    h="10"
    px="3"
    bg="bg.contrast"
    color="fg.contrast"
    rounded="l2"
    position="relative"
    overflow="hidden"
  >
    <Text>Button</Text>

    <Ripple {...rippleProps} />
  </Center>
)
```

Alternatively, you can disable it by setting `disabled` to `true` on `Ripple`.

```tsx preview functional client
const { onClick, ...rippleProps } = useRipple()

return (
  <Center
    as="button"
    type="button"
    onClick={onClick}
    h="10"
    px="3"
    bg="bg.contrast"
    color="fg.contrast"
    rounded="l2"
    position="relative"
    overflow="hidden"
  >
    <Text>Button</Text>

    <Ripple disabled {...rippleProps} />
  </Center>
)
```

## Props

<PropsTable name="ripple" />
